# coding=utf-8
"""
author: jamon
"""
import pygame
import sys

if __name__ == "__main__":
    import os
    sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))


import asyncio
from client.views.scene_mgr import scene_mgr
from client.application import Application
from obespoir.share.espoir_log import global_log as logger


def main():
    logger.init_log_config(module_name="estank", log_dir="./logs",
                           log_type="both")
    app = Application()
    app.start()

    pygame.display.set_caption("坦克大战")
    screen = pygame.display.set_mode((630, 630))
    scene_mgr.set_screen(screen, app)
    scene_mgr.switch_to_scene("login")
    # need_quit = main()
    # if need_quit:
    #     pygame.quit()
    #     sys.exit()
    # for event in pygame.event.get():
    #     if pygame.QUIT == event.type:
    #         pygame.quit()
    #         sys.exit()
    app.run()


if __name__ == "__main__":
    main()
